'''
This file Define Function for Loading Trainning Set and Parameters for Network
'''

import numpy as np
import torch
import random
import scipy.constants as Const
from scipy.io import loadmat

# Total number of BS antennas, M in paper
BSantennasNum = 16
# Total number of RIS unit cells, N in paper
RISunitsNum = 64
# Total number of UE antennas, always 1
UEantenna = 1
# Number of RIS unit cells in a group, N0 = 2/4 in paper
UnitsInGroup = 2
# Signal-Noise-Ratio in system, dB
SNR = 10
# 5G carrier frequency
Carrierfrequency = 2595.e6
# Signal bandwidth
Bandwidth = 160.e6
# Signal wave length
lamb = Const.speed_of_light / Carrierfrequency
# Pi
Pi = Const.pi
# load file number
FileNum = 10


class TrainSetLoad:

    def LoadTrainSet():
        # (ChannelMatrix, Omega, Phi, UErx)
        MatData = loadmat('Data/TrainSet.mat')
        return MatData
    
    def NetworkInput(Data):
        np.random.shuffle(Data)
        Data = torch.tensor(Data)
        return Data


